package wang.hu.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import wang.hu.crm.domain.Customer;

public interface CustomerService {

	// 查询未关联的客户 没有定区id的客户
	@Path("/nolinkedcustomers")
	@GET
	@Consumes
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoLinkedCustomers();

	// 查询已关联的客户 根据定区ID
	@Path("/haslinkedcustomers/{fixedareaid}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findHasLinkedCustomers(
			@PathParam("fixedareaid") String fixedAreaId);

	// 将选中的客户关联到指定定区
	@Path("/linkedcustomerstofixedarea")
	@PUT
	public void linkedCustomersToFixedArea(
			@QueryParam("customeridstr") String customerIdStr,
			@QueryParam("fixedareaid") String fixedAreaId);

	@Path("/savecustomer")
	@POST
	@Consumes({ "application/xml", "application/json" })
	public String saveCustomer(Customer customer);

	@Path("/telephone/{telephone}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public Customer findByTelephone(@PathParam("telephone") String telephone);

	@Path("/changetype/{telephone}")
	@GET
	public void setType(@PathParam("telephone") String telephone);

	@Path("/login")
	@GET
	@Produces({ "application/xml", "application/json" })
	public Customer login(@QueryParam("telephone") String telephone,
			@QueryParam("password") String password);

	@Path("/findfixedareaId/{address}")
	@GET
	@Produces({ "application/xml", "application/json" })
	String findFixedAreaIdByAddress(@PathParam("address") String address);
}
